﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="Ver_Adiantamentos.ascx.cs" Inherits="HRP.Private.Funcionarios.Controlos.Ver_Adiantamentos" %>
<%@ Import Namespace="HRP.Utilidades" %>
<div class="user-profile-content">
    <br />
    <div class="row">
        <div class="col-sm-8">
            <h5><strong>Histórico de Adiantamentos</strong></h5>
        </div>
        <div class="col-sm-4">
            <div class="toolbar-btn-action">
                <a class="btn btn-success md-trigger marginRight5" href="Adiantamentos/Criar.aspx?funcId=<%=NumFuncionario%>">Registar Adiantamento <i class="fa fa-plus-circle"></i></a>
            </div>
        </div>
        <div class="col-sm-12">
            <%if (adiantamentosTable.Items.Count == 0)
              { %>
            <p class="text-muted">
                Não tem adiantamentos registados.
            </p>
            <%}
              else
              { %>
            <asp:Repeater runat="server" ID="adiantamentosTable">
                <HeaderTemplate>
                    <div class="table-responsive">
                        <table class="table table-hover table-message">
                            <thead>
                                <tr>
                                    <th>Data</th>
                                    <th>Mês</th>
                                    <th>Ano</th>
                                    <th>Valor</th>
                                    <th>Observação</th>
                                    <th>Modo Pagamento</th>
                                    <th>Estado</th>
                                    <th data-sortable="false">Abrir
                                    </th>
                                </tr>
                            </thead>
                            <tbody>
                </HeaderTemplate>
                <ItemTemplate>
                    <tr>
                        <td>
                            <%#((DateTime)Eval("user_timestamp")).ToString(DefinicoesSite.DataFormato)%>
                        </td>
                        <td>
                            <%#Eval("mes")%>
                        </td>
                        <td>
                            <%#Eval("ano")%>
                        </td>
                        <td>
                            <%#Eval("valor")%>
                        </td>
                        <td>
                            <%#Eval("descricao")%>
                        </td>
                        <td>
                            <%#Eval("modo_pagamento")%>
                        </td>
                        <td>
                            <span class="label <%#(bool)Eval("estado") ? "label-success" : "label-danger"%> ">
                                <%#(bool)Eval("estado") ? "Pago" : "Cancelado"%></span>
                        </td>

                        <td>
                            <div class="btn-group btn-group-xs">

                                <asp:LinkButton ID="activarDesButton" data-toggle="tooltip" ToolTip="Cancelar"
                                    CssClass="btn btn-default"
                                    runat="server" CommandArgument='<%#Eval("id") %>' OnCommand="alterarEstadoAdiantamento">
                                    <i class="fa fa-power-off"></i></asp:LinkButton>


                                <asp:LinkButton ID="LinkButton1" data-toggle="tooltip" ToolTip="Imprimir Adiantamento"
                                    CssClass="btn btn-default"
                                    runat="server" CommandArgument='<%#Eval("id") %>' OnCommand="ImprimirComprovativo">
                                    <i class="fa fa-print"></i></asp:LinkButton>


                            </div>
                        </td>
                    </tr>
                </ItemTemplate>
                <FooterTemplate>
                    </tbody></table></div>
                </FooterTemplate>
            </asp:Repeater>
            <%} %>
        </div>
    </div>
</div>
